package com.lidd.selffood.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lidd.selffood.common.ResultInfo;
import com.lidd.selffood.db.bean.GoodsCategory;
import com.lidd.selffood.service.IGoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品类别 前端控制器
 * </p>
 *
 * @author lixunhuan
 * @since 2021-05-29
 */
@RestController
@RequestMapping("/goods_category")
public class GoodsCategoryController {

    @Autowired
    private IGoodsCategoryService goodsCategoryService;
    @RequestMapping("get")
    public ResultInfo getCategory(){
        return new ResultInfo(ResultInfo.Status.SUCCESS).result(
              goodsCategoryService.list(new QueryWrapper<GoodsCategory>().eq("show_status","1"))
        );
    }

}
